package com.foreknow.demo10;

/**
 * == 与 equals的区别
 *
 * == 引用类型使用==比较的是内存地址
 * equals 比较的是内容是否相等
 */
public class EqualsDemo {
    public static void main(String[] args) {
        String s1 = "haha";
        String s2 = "haha";
        String s3 = new String("hh");
        String s4 = "ha"+"ha";
        String s5 = new String("ha")+"ha";

        System.out.println(s1.equals(s3));
    }
}
